package com.zgjkhis.modules.statistics.resp;

import cn.hutool.core.bean.BeanUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zgjkhis.modules.system.domain.Drug;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author yxl
 * @Description
 * @Date 2021/12/24 11:03
 **/
@Data
public class DrugStatisticsDto {

    @ApiModelProperty(value = "记录id")
    private Long id;
    @ApiModelProperty(value = "药品id")
    private Long drugId;
    @ApiModelProperty(value = "药品名称")
    private String drugName;
    @ApiModelProperty(value = "剂量单位(当药品分类为3，4，5时，为最小剂量单位)")
    private String doseUnit;
    @ApiModelProperty(value = "包装单位")
    private String packageUnit;
    @ApiModelProperty(value = "库存")
    private Integer stock;
    @ApiModelProperty(value = "最小单位库存")
    private Integer minStock;
    @ApiModelProperty(value = "药品分类1:中药饮片，2：配方颗粒，3：中成药，4：西药，5：耗材，6敷贴粉剂")
    private Integer drugType;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "销量")
    private Integer quantity;
    @ApiModelProperty(value = "销售额")
    private BigDecimal price;
    @ApiModelProperty(value = "成本")
    private BigDecimal costPrice;
    @ApiModelProperty(value = "利润")
    private BigDecimal profit;

    public void copy(Drug drug) {
        Date createTime = this.createTime;
        Long id = this.id;
        BeanUtil.copyProperties(drug, this);
        this.createTime = createTime;
        this.id = id;
    }

}
